Spatial environmental data analysis with R

Adam M. Wilson
August 31, 2015

GEO 503

  • Course: Mondays 3-5pm 144 Wilkeson Quad
  • Office Hours: Mondays 3-5pm, 120 Wilkeson Quad

Spatial environmental data analysis with R

For more details on authoring R presentations click the Help button on the toolbar.

  • Bullet 1
  • Bullet 2
  • Bullet 3

The R Project for Statistical Computing

  • Open source
  • Data manipulation
  • Data analysis tools
  • Great graphics
  • Programming language
  • 6,000+ free, community-contributed packages
  • A supportive and increasing user community

R is a dialect of the S language and environment developed at Bell Laboratories (formerly AT&T) by John Chambers and colleagues (the same group that developed C and UNIX©)

What is the R environment?

  • an effective data handling and storage facility
  • a suite of operators for (vectorized) calculations
  • a large, coherent, integrated collection of tools for data analysis
  • graphical capabilities (screen or hardcopy)
  • a well-developed, simple, and effective programming language which includes
    • conditionals
    • loops
    • user defined functions
    • input and output facilities

R Packages

packages Over 6k packages! Task Views organize packages by topic: [http://cran.r-project.org/web/views/]

Other Resources

R Books

Reproducible, Portable, & Transparent

Mann Climate curve

“… all the code and data used to recreate Mann’s original analysis has been made available to the public […] in R” Matthew Pocernich, R news 6/4, 10/31/06

Figures in R

If you can imagine it…

Map

source

Figures in R

If you can imagine it…

weather source

Spatial Analysis & Visualization

Packages: sp, maptools, rgeos, raster, ggmap

Example: species range overlays ranges source

Spatial Analysis & Visualization

Packages: sp, maptools, rgeos, raster, ggmap

Example: Visualizing Data with basemaps with ggmap Robbery Map source

Parallel Processing

For BIG jobs:

multi-core processors / high performance computing

parallel

Strengths & Limitations

  • Just-in-time compilation:
    • Slower than compiled languages (-)
    • Faster to compose and develop (+)
  • Many available packages (+)
  • Most operations conducted in RAM
    • RAM can be limiting and/or expensive (-)
    • “Error: cannot allocate vector of size X Mb”
    • Various packages and clever programming can overcome this… (+)
  • Free like beer and speech! (+)